package com.tensquare.recurit.controller;

import com.tensquare.recurit.pojo.Enterprise;
import com.tensquare.recurit.service.EnterpriseService;
import entity.Result;
import entity.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("enterprise")
public class EnterpriseController {

    @Autowired
    private EnterpriseService enterpriseService;

    //1.查询热门企业列表
    @GetMapping("search/hotlist")
    public Result getHotList(){
        //1.调用服务查询热门企业
        List<Enterprise> hotList = enterpriseService.getHotList();
        //2.返回结果
        return new Result(true,StatusCode.OK,"查询热门企业成功！",hotList);
    }

}
